# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-fake-useragent
pkgname=('python2-fake-useragent' 'python-fake-useragent')
_pkgname=fake-useragent
pkgver=2.2.0
pkgrel=1
pkgdesc='Up to date simple useragent faker with real world database.'
arch=('any')
url='https://pypi.org/project/fake-useragent/#files'
license=('Apache')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('3ff26c9467fc1e242f9aad7a225a2b463d57a454d919170c9f0b26b857d1d983803d43109ec939560493bf01d5cc7d825f3cc5b9d2b9c5b951166b9e612e3ad9')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-fake-useragent() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-fake-useragent() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

